home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
ab20
/
unarced
/
utilities
/
shells
/
sksh
/
scr_source
/
qrm.s
< prev
next >
Wrap
Text File
|
1995-03-17
|
999b
|
31 lines
#!c:sksh
#*************************************************************************
# This function accepts a number of parameters, and prompts the user
# for whether these files should be deleted. For example, "qrm *.o"
# would prompt the user at each .o file. Answering "Y" or "y" causes
# the file to be removed; otherwise, it is ignored. A useful extention
# would look at only the first character of the response, thus allowing
# "yes" to be used in place of "y".
#*************************************************************************
local _ans _fspec
if [ "$#" -eq 0 -o "$1" = '-?' ]
then
echo 'Usage:' $(basename $0) 'man-entry'
echo ' (Displays man page entries from the MAN: directory)'
return 1
fi
for _fspec in $*
do
[ -f "$_fspec" ] || echo "File '$_fspec' does not exist." && continue
echo -n "Remove $_fspec ? "
read _ans
[ $(expr substr $(toupper "$_ans") 1 1) = 'Y' ] && rm -vf "$_fspec"
done